<% @groupedTasks.each do |event_id,tasks| %>
  <div id="taskEventDiv">
  <table>
    <tr>
    <th align="left"><font color="red"><%= Event.find_by_id(event_id).nil? ? "Other" : Event.find_by_id(event_id).title %></font></th>
    <th align="left" width="100">Priority</th>
    <th align="left" width="100">Category</th>
    <th align="right" width="50"></td>
    </tr>
    <% for task in tasks %>
      <tr>
        <td>
          <span class="<%= getTaskPriority(task) %>">
          <%= link_to task.description, task_path(task) %>
          </span>
        </td>
        <td align="left" width="100"><%= task.priority %></td>
        <td align="left" width="100"><% if task.category.nil? %> <% else %> <%= image_tag(task.category.imageFile, :border => 0) %><% end %></td>
        <td align="right" width="50" class="linkIcons"><%= link_to image_tag( "edit.png", :border => 0 ), edit_task_path(task) %> <%= link_to image_tag( "trash.png", :border => 0 ), task, :confirm => 'Are you sure?', :method => :delete %></td>
      </tr>
    <% end %>
  </table>
  </div>
<br>
<% end %>

